package com.bright.cwduijie.duijie.pojo.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Data;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author  hxj
 * @Date 2024-07-15 13:17:56 
 * @Description
 */

@Data
@Entity
@Table(name ="DJ_HTXX")
public class Contract implements Serializable {

    private static final long serialVersionUID =  5110743433849038903L;

    /**
     * 主键ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @JsonIgnore
    @Column(name = "ID")
    private Integer ID;

    /**
     * 数据唯一标识
     */
    @NotNull
    @Length(max = 36)
    @Column(name = "DATA_KEY")
    private String DATA_KEY;

    /**
     * 所属组织的统一社会信用代码
     */
    @NotNull
    @Length(max = 18)
    @Column(name = "TYSHXYDM")
    private String TYSHXYDM;

    /**
     * 合同类型
     */
    @Column(name = "TYPE")
    private Integer TYPE;

    /**
     * 合同编号
     */
    @NotBlank
    @Length(max = 40)
    @Column(name = "CODE")
    private String CODE;

    /**
     * 合同名称
     */
    @NotBlank
    @Length(max = 128)
    @Column(name = "NAME")
    private String NAME;

    /**
     * 签订日期
     */
    @NotNull
    @Column(name = "SIGNING_DATE")
    private Date SIGNING_DATE;

    /**
     * 合同开始日期
     */
    @NotNull
    @Column(name = "START_DATE")
    private Date START_DATE;

    /**
     * 合同结束日期
     */
    @Column(name = "END_DATE")
    private Date END_DATE;

    /**
     * 合同属性
     */
    @NotNull
    @Column(name = "ATTRIBUTE")
    private Integer ATTRIBUTE;

    /**
     * 合同金额
     */
    @Column(name = "AMOUNT")
    private BigDecimal AMOUNT;

    /**
     * 是否招投标
     */
    @Column(name = "BID_FLAG")
    private Integer BID_FLAG;

    /**
     * 投资方式
     */
    @Column(name = "INVESTMENT_APPROACH")
    private Integer INVESTMENT_APPROACH;

    /**
     * 甲方名称
     */
    @NotBlank
    @Length(max = 128)
    @Column(name = "FIRST_PARTY_NAME")
    private String FIRST_PARTY_NAME;

    /**
     * 甲方代表人
     */
    @NotBlank
    @Length(max = 128)
    @Column(name = "FIRST_PARTY_REPRESENTATIVE")
    private String FIRST_PARTY_REPRESENTATIVE;

    /**
     * 甲方联系方式
     */
    @Length(max = 64)
    @Column(name = "FIRST_PARTY_CONTACT")
    private String FIRST_PARTY_CONTACT;

    /**
     * 乙方名称
     */
    @NotBlank
    @Length(max = 128)
    @Column(name = "SECOND_PARTY_NAME")
    private String SECOND_PARTY_NAME;

    /**
     * 乙方代表人
     */
    @NotBlank
    @Length(max = 128)
    @Column(name = "SECOND_PARTY_REPRESENTATIVE")
    private String SECOND_PARTY_REPRESENTATIVE;

    /**
     * 乙方联系方式
     */
    @Length(max = 64)
    @Column(name = "SECOND_PARTY_CONTACT")
    private String SECOND_PARTY_CONTACT;

    @Transient
    private List<ContractAssets> ASSET_LIST;

    @Transient
    private List<ContractReceipt> RECEIPT_SCHEDULE_LIST;

    @Transient
    private List<ContractPayment> PAYMENT_SCHEDULE_LIST;

    /**
     * 合同状态
     */
    @NotNull
    @Column(name = "STATE")
    private Integer STATE;

    @JsonIgnore
    @Column(name = "sjjhbz")
    private Integer sjjhbz;

    @JsonIgnore
    @Column(name = "opType")
    private Integer opType;

    @JsonIgnore
    @Column(name = "taskId")
    private String taskId;

}
